package com.dt.platform.domain.hr;

import com.github.foxnic.dao.entity.Entity;
import io.swagger.annotations.ApiModel;
import javax.persistence.Table;
import com.github.foxnic.sql.meta.DBTable;
import com.dt.platform.constants.db.HrTables.HR_PAPER_QUESTION_REL;
import javax.persistence.Id;
import io.swagger.annotations.ApiModelProperty;
import java.math.BigDecimal;
import java.util.Date;
import javax.persistence.Transient;
import com.github.foxnic.api.swagger.EnumFor;
import org.github.foxnic.web.domain.system.DictItem;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.github.foxnic.commons.lang.DataParser;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map;
import com.github.foxnic.dao.entity.EntityContext;
import com.dt.platform.domain.hr.meta.PaperQuestionRelMeta;
import com.github.foxnic.sql.data.ExprRcd;



/**
 * 选择题目
 * <p>选择题目 , 数据表 hr_paper_question_rel 的PO类型</p>
 * @author 金杰 , maillank@qq.com
 * @since 2024-10-04 20:04:44
 * @sign DCADE18536D6C6E394285803FE1438F4
 * 此文件由工具自动生成，请勿修改。若表结构或配置发生变动，请使用工具重新生成。
*/

@Table(name = "hr_paper_question_rel")
@ApiModel(description = "选择题目 ; 选择题目 , 数据表 hr_paper_question_rel 的PO类型")
public class PaperQuestionRel extends Entity {

	private static final long serialVersionUID = 1L;

	public static final DBTable TABLE =HR_PAPER_QUESTION_REL.$TABLE;
	
	/**
	 * 主键：主键
	*/
	@Id
	@ApiModelProperty(required = true,value="主键" , notes = "主键" , example = "595144132128837")
	private String id;
	
	/**
	 * 试卷：试卷
	*/
	@ApiModelProperty(required = false,value="试卷" , notes = "试卷" , example = "595144132005957")
	private String paperId;
	
	/**
	 * 题库：题库
	*/
	@ApiModelProperty(required = false,value="题库" , notes = "题库" , example = "591815482802246")
	private String learnPaperId;
	
	/**
	 * 关联题目：关联题目
	*/
	@ApiModelProperty(required = false,value="关联题目" , notes = "关联题目" , example = "606087695550119941")
	private String questionId;
	
	/**
	 * 题目类型：题目类型
	*/
	@ApiModelProperty(required = false,value="题目类型" , notes = "题目类型" , example = "choice")
	private String questionType;
	
	/**
	 * 题目标题：题目标题
	*/
	@ApiModelProperty(required = false,value="题目标题" , notes = "题目标题" , example = "以下哪些是动画？")
	private String questionName;
	
	/**
	 * 图片：图片
	*/
	@ApiModelProperty(required = false,value="图片" , notes = "图片")
	private String questionImageId;
	
	/**
	 * 附件：附件
	*/
	@ApiModelProperty(required = false,value="附件" , notes = "附件")
	private String questionFileId;
	
	/**
	 * 题目序号：题目序号
	*/
	@ApiModelProperty(required = false,value="题目序号" , notes = "题目序号" , example = "1")
	private Integer questionNumber;
	
	/**
	 * 问题难度：问题难度
	*/
	@ApiModelProperty(required = false,value="问题难度" , notes = "问题难度")
	private String questionLevel;
	
	/**
	 * 问题解析：问题解析
	*/
	@ApiModelProperty(required = false,value="问题解析" , notes = "问题解析")
	private String questionAnalysis;
	
	/**
	 * 题目内容：题目内容
	*/
	@ApiModelProperty(required = false,value="题目内容" , notes = "题目内容" , example = "[{\"item\":\"名侦探柯南\",\"code\":\"A\",\"id\":\"606087484924755974\"},{\"item\":\"还珠格格\",\"code\":\"B\",\"id\":\"606087536997040134...")
	private String itemText;
	
	/**
	 * 用户答案：用户答案
	*/
	@ApiModelProperty(required = false,value="用户答案" , notes = "用户答案")
	private String itemAnswerText;
	
	/**
	 * 正确答案：正确答案
	*/
	@ApiModelProperty(required = false,value="正确答案" , notes = "正确答案" , example = "[{\"code\":\"A\",\"id\":\"606087484924755974\"},{\"code\":\"C\",\"id\":\"606087585726464006\"},{\"code\":\"D\",\"id\":\"60608765...")
	private String itemAnswerTextRight;
	
	/**
	 * 是否答题：是否答题
	*/
	@ApiModelProperty(required = false,value="是否答题" , notes = "是否答题" , example = "yes")
	private String isAnswer;
	
	/**
	 * 得分：得分
	*/
	@ApiModelProperty(required = false,value="得分" , notes = "得分" , example = "10.0")
	private BigDecimal score;
	
	/**
	 * 排序：排序
	*/
	@ApiModelProperty(required = false,value="排序" , notes = "排序" , example = "0")
	private Integer sort;
	
	/**
	 * 创建人ID：创建人ID
	*/
	@ApiModelProperty(required = false,value="创建人ID" , notes = "创建人ID" , example = "110588348101165911")
	private String createBy;
	
	/**
	 * 创建时间：创建时间
	*/
	@ApiModelProperty(required = false,value="创建时间" , notes = "创建时间" , example = "2024-09-19 04:55:34")
	private Date createTime;
	
	/**
	 * 修改人ID：修改人ID
	*/
	@ApiModelProperty(required = false,value="修改人ID" , notes = "修改人ID")
	private String updateBy;
	
	/**
	 * 修改时间：修改时间
	*/
	@ApiModelProperty(required = false,value="修改时间" , notes = "修改时间")
	private Date updateTime;
	
	/**
	 * 是否已删除：是否已删除
	*/
	@ApiModelProperty(required = true,value="是否已删除" , notes = "是否已删除" , example = "0")
	private Integer deleted;
	@Transient
	@EnumFor("deleted")
	private Boolean deletedBool;
	
	/**
	 * 删除人ID：删除人ID
	*/
	@ApiModelProperty(required = false,value="删除人ID" , notes = "删除人ID")
	private String deleteBy;
	
	/**
	 * 删除时间：删除时间
	*/
	@ApiModelProperty(required = false,value="删除时间" , notes = "删除时间")
	private Date deleteTime;
	
	/**
	 * version：version
	*/
	@ApiModelProperty(required = true,value="version" , notes = "version" , example = "1")
	private Integer version;
	
	/**
	 * levelDict：levelDict
	*/
	@ApiModelProperty(required = false,value="levelDict" , notes = "levelDict")
	private DictItem levelDict;
	
	/**
	 * learnPaper：learnPaper
	*/
	@ApiModelProperty(required = false,value="learnPaper" , notes = "learnPaper")
	private LearnPaper learnPaper;
	
	/**
	 * Paper：Paper
	*/
	@ApiModelProperty(required = false,value="Paper" , notes = "Paper")
	private Paper Paper;
	
	/**
	 * paperQuestion：paperQuestion
	*/
	@ApiModelProperty(required = false,value="paperQuestion" , notes = "paperQuestion")
	private PaperQuestion paperQuestion;
	
	/**
	 * selectedCode：selectedCode
	*/
	@ApiModelProperty(required = false,value="selectedCode" , notes = "selectedCode")
	private String selectedCode;
	
	/**
	 * paperQuestionItemList：paperQuestionItemList
	*/
	@ApiModelProperty(required = false,value="paperQuestionItemList" , notes = "paperQuestionItemList")
	private List<PaperQuestionItem> paperQuestionItemList;
	
	/**
	 * paperQuestionAnswerList：paperQuestionAnswerList
	*/
	@ApiModelProperty(required = false,value="paperQuestionAnswerList" , notes = "paperQuestionAnswerList")
	private List<PaperQuestionAnswer> paperQuestionAnswerList;
	
	/**
	 * 获得 主键<br>
	 * 主键
	 * @return 主键
	*/
	public String getId() {
		return id;
	}
	
	/**
	 * 设置 主键
	 * @param id 主键
	 * @return 当前对象
	*/
	public PaperQuestionRel setId(String id) {
		this.id=id;
		return this;
	}
	
	/**
	 * 获得 试卷<br>
	 * 试卷
	 * @return 试卷
	*/
	public String getPaperId() {
		return paperId;
	}
	
	/**
	 * 设置 试卷
	 * @param paperId 试卷
	 * @return 当前对象
	*/
	public PaperQuestionRel setPaperId(String paperId) {
		this.paperId=paperId;
		return this;
	}
	
	/**
	 * 获得 题库<br>
	 * 题库
	 * @return 题库
	*/
	public String getLearnPaperId() {
		return learnPaperId;
	}
	
	/**
	 * 设置 题库
	 * @param learnPaperId 题库
	 * @return 当前对象
	*/
	public PaperQuestionRel setLearnPaperId(String learnPaperId) {
		this.learnPaperId=learnPaperId;
		return this;
	}
	
	/**
	 * 获得 关联题目<br>
	 * 关联题目
	 * @return 关联题目
	*/
	public String getQuestionId() {
		return questionId;
	}
	
	/**
	 * 设置 关联题目
	 * @param questionId 关联题目
	 * @return 当前对象
	*/
	public PaperQuestionRel setQuestionId(String questionId) {
		this.questionId=questionId;
		return this;
	}
	
	/**
	 * 获得 题目类型<br>
	 * 题目类型
	 * @return 题目类型
	*/
	public String getQuestionType() {
		return questionType;
	}
	
	/**
	 * 设置 题目类型
	 * @param questionType 题目类型
	 * @return 当前对象
	*/
	public PaperQuestionRel setQuestionType(String questionType) {
		this.questionType=questionType;
		return this;
	}
	
	/**
	 * 获得 题目标题<br>
	 * 题目标题
	 * @return 题目标题
	*/
	public String getQuestionName() {
		return questionName;
	}
	
	/**
	 * 设置 题目标题
	 * @param questionName 题目标题
	 * @return 当前对象
	*/
	public PaperQuestionRel setQuestionName(String questionName) {
		this.questionName=questionName;
		return this;
	}
	
	/**
	 * 获得 图片<br>
	 * 图片
	 * @return 图片
	*/
	public String getQuestionImageId() {
		return questionImageId;
	}
	
	/**
	 * 设置 图片
	 * @param questionImageId 图片
	 * @return 当前对象
	*/
	public PaperQuestionRel setQuestionImageId(String questionImageId) {
		this.questionImageId=questionImageId;
		return this;
	}
	
	/**
	 * 获得 附件<br>
	 * 附件
	 * @return 附件
	*/
	public String getQuestionFileId() {
		return questionFileId;
	}
	
	/**
	 * 设置 附件
	 * @param questionFileId 附件
	 * @return 当前对象
	*/
	public PaperQuestionRel setQuestionFileId(String questionFileId) {
		this.questionFileId=questionFileId;
		return this;
	}
	
	/**
	 * 获得 题目序号<br>
	 * 题目序号
	 * @return 题目序号
	*/
	public Integer getQuestionNumber() {
		return questionNumber;
	}
	
	/**
	 * 设置 题目序号
	 * @param questionNumber 题目序号
	 * @return 当前对象
	*/
	public PaperQuestionRel setQuestionNumber(Integer questionNumber) {
		this.questionNumber=questionNumber;
		return this;
	}
	
	/**
	 * 获得 问题难度<br>
	 * 问题难度
	 * @return 问题难度
	*/
	public String getQuestionLevel() {
		return questionLevel;
	}
	
	/**
	 * 设置 问题难度
	 * @param questionLevel 问题难度
	 * @return 当前对象
	*/
	public PaperQuestionRel setQuestionLevel(String questionLevel) {
		this.questionLevel=questionLevel;
		return this;
	}
	
	/**
	 * 获得 问题解析<br>
	 * 问题解析
	 * @return 问题解析
	*/
	public String getQuestionAnalysis() {
		return questionAnalysis;
	}
	
	/**
	 * 设置 问题解析
	 * @param questionAnalysis 问题解析
	 * @return 当前对象
	*/
	public PaperQuestionRel setQuestionAnalysis(String questionAnalysis) {
		this.questionAnalysis=questionAnalysis;
		return this;
	}
	
	/**
	 * 获得 题目内容<br>
	 * 题目内容
	 * @return 题目内容
	*/
	public String getItemText() {
		return itemText;
	}
	
	/**
	 * 设置 题目内容
	 * @param itemText 题目内容
	 * @return 当前对象
	*/
	public PaperQuestionRel setItemText(String itemText) {
		this.itemText=itemText;
		return this;
	}
	
	/**
	 * 获得 用户答案<br>
	 * 用户答案
	 * @return 用户答案
	*/
	public String getItemAnswerText() {
		return itemAnswerText;
	}
	
	/**
	 * 设置 用户答案
	 * @param itemAnswerText 用户答案
	 * @return 当前对象
	*/
	public PaperQuestionRel setItemAnswerText(String itemAnswerText) {
		this.itemAnswerText=itemAnswerText;
		return this;
	}
	
	/**
	 * 获得 正确答案<br>
	 * 正确答案
	 * @return 正确答案
	*/
	public String getItemAnswerTextRight() {
		return itemAnswerTextRight;
	}
	
	/**
	 * 设置 正确答案
	 * @param itemAnswerTextRight 正确答案
	 * @return 当前对象
	*/
	public PaperQuestionRel setItemAnswerTextRight(String itemAnswerTextRight) {
		this.itemAnswerTextRight=itemAnswerTextRight;
		return this;
	}
	
	/**
	 * 获得 是否答题<br>
	 * 是否答题
	 * @return 是否答题
	*/
	public String getIsAnswer() {
		return isAnswer;
	}
	
	/**
	 * 设置 是否答题
	 * @param isAnswer 是否答题
	 * @return 当前对象
	*/
	public PaperQuestionRel setIsAnswer(String isAnswer) {
		this.isAnswer=isAnswer;
		return this;
	}
	
	/**
	 * 获得 得分<br>
	 * 得分
	 * @return 得分
	*/
	public BigDecimal getScore() {
		return score;
	}
	
	/**
	 * 设置 得分
	 * @param score 得分
	 * @return 当前对象
	*/
	public PaperQuestionRel setScore(BigDecimal score) {
		this.score=score;
		return this;
	}
	
	/**
	 * 获得 排序<br>
	 * 排序
	 * @return 排序
	*/
	public Integer getSort() {
		return sort;
	}
	
	/**
	 * 设置 排序
	 * @param sort 排序
	 * @return 当前对象
	*/
	public PaperQuestionRel setSort(Integer sort) {
		this.sort=sort;
		return this;
	}
	
	/**
	 * 获得 创建人ID<br>
	 * 创建人ID
	 * @return 创建人ID
	*/
	public String getCreateBy() {
		return createBy;
	}
	
	/**
	 * 设置 创建人ID
	 * @param createBy 创建人ID
	 * @return 当前对象
	*/
	public PaperQuestionRel setCreateBy(String createBy) {
		this.createBy=createBy;
		return this;
	}
	
	/**
	 * 获得 创建时间<br>
	 * 创建时间
	 * @return 创建时间
	*/
	public Date getCreateTime() {
		return createTime;
	}
	
	/**
	 * 设置 创建时间
	 * @param createTime 创建时间
	 * @return 当前对象
	*/
	public PaperQuestionRel setCreateTime(Date createTime) {
		this.createTime=createTime;
		return this;
	}
	
	/**
	 * 获得 修改人ID<br>
	 * 修改人ID
	 * @return 修改人ID
	*/
	public String getUpdateBy() {
		return updateBy;
	}
	
	/**
	 * 设置 修改人ID
	 * @param updateBy 修改人ID
	 * @return 当前对象
	*/
	public PaperQuestionRel setUpdateBy(String updateBy) {
		this.updateBy=updateBy;
		return this;
	}
	
	/**
	 * 获得 修改时间<br>
	 * 修改时间
	 * @return 修改时间
	*/
	public Date getUpdateTime() {
		return updateTime;
	}
	
	/**
	 * 设置 修改时间
	 * @param updateTime 修改时间
	 * @return 当前对象
	*/
	public PaperQuestionRel setUpdateTime(Date updateTime) {
		this.updateTime=updateTime;
		return this;
	}
	
	/**
	 * 获得 是否已删除<br>
	 * 是否已删除
	 * @return 是否已删除
	*/
	public Integer getDeleted() {
		return deleted;
	}
	
	/**
	 * 获得 是否已删除 的投影属性<br>
	 * 等价于 getDeleted 方法，获得对应的枚举类型
	 * @return 是否已删除
	*/
	@Transient
	public Boolean isDeleted() {
		if(this.deletedBool==null) {
			this.deletedBool=DataParser.parseBoolean(deleted);
		}
		return this.deletedBool ;
	}
	
	/**
	 * 设置 是否已删除
	 * @param deleted 是否已删除
	 * @return 当前对象
	*/
	@JsonProperty("deleted")
	public PaperQuestionRel setDeleted(Integer deleted) {
		this.deleted=deleted;
		this.deletedBool=DataParser.parseBoolean(deleted);
		return this;
	}
	
	/**
	 * 设置 是否已删除的投影属性，等同于设置 是否已删除
	 * @param deletedBool 是否已删除
	 * @return 当前对象
	*/
	@Transient
	public PaperQuestionRel setDeleted(Boolean deletedBool) {
		if(deletedBool==null) {
			this.deleted=null;
		} else {
			this.deleted=deletedBool?1:0;
		}
		this.deletedBool=deletedBool;
		return this;
	}
	
	/**
	 * 获得 删除人ID<br>
	 * 删除人ID
	 * @return 删除人ID
	*/
	public String getDeleteBy() {
		return deleteBy;
	}
	
	/**
	 * 设置 删除人ID
	 * @param deleteBy 删除人ID
	 * @return 当前对象
	*/
	public PaperQuestionRel setDeleteBy(String deleteBy) {
		this.deleteBy=deleteBy;
		return this;
	}
	
	/**
	 * 获得 删除时间<br>
	 * 删除时间
	 * @return 删除时间
	*/
	public Date getDeleteTime() {
		return deleteTime;
	}
	
	/**
	 * 设置 删除时间
	 * @param deleteTime 删除时间
	 * @return 当前对象
	*/
	public PaperQuestionRel setDeleteTime(Date deleteTime) {
		this.deleteTime=deleteTime;
		return this;
	}
	
	/**
	 * 获得 version<br>
	 * version
	 * @return version
	*/
	public Integer getVersion() {
		return version;
	}
	
	/**
	 * 设置 version
	 * @param version version
	 * @return 当前对象
	*/
	public PaperQuestionRel setVersion(Integer version) {
		this.version=version;
		return this;
	}
	
	/**
	 * 获得 levelDict<br>
	 * levelDict
	 * @return levelDict
	*/
	public DictItem getLevelDict() {
		return levelDict;
	}
	
	/**
	 * 设置 levelDict
	 * @param levelDict levelDict
	 * @return 当前对象
	*/
	public PaperQuestionRel setLevelDict(DictItem levelDict) {
		this.levelDict=levelDict;
		return this;
	}
	
	/**
	 * 获得 learnPaper<br>
	 * learnPaper
	 * @return learnPaper
	*/
	public LearnPaper getLearnPaper() {
		return learnPaper;
	}
	
	/**
	 * 设置 learnPaper
	 * @param learnPaper learnPaper
	 * @return 当前对象
	*/
	public PaperQuestionRel setLearnPaper(LearnPaper learnPaper) {
		this.learnPaper=learnPaper;
		return this;
	}
	
	/**
	 * 获得 Paper<br>
	 * Paper
	 * @return Paper
	*/
	public Paper getPaper() {
		return Paper;
	}
	
	/**
	 * 设置 Paper
	 * @param Paper Paper
	 * @return 当前对象
	*/
	public PaperQuestionRel setPaper(Paper Paper) {
		this.Paper=Paper;
		return this;
	}
	
	/**
	 * 获得 paperQuestion<br>
	 * paperQuestion
	 * @return paperQuestion
	*/
	public PaperQuestion getPaperQuestion() {
		return paperQuestion;
	}
	
	/**
	 * 设置 paperQuestion
	 * @param paperQuestion paperQuestion
	 * @return 当前对象
	*/
	public PaperQuestionRel setPaperQuestion(PaperQuestion paperQuestion) {
		this.paperQuestion=paperQuestion;
		return this;
	}
	
	/**
	 * 获得 selectedCode<br>
	 * selectedCode
	 * @return selectedCode
	*/
	public String getSelectedCode() {
		return selectedCode;
	}
	
	/**
	 * 设置 selectedCode
	 * @param selectedCode selectedCode
	 * @return 当前对象
	*/
	public PaperQuestionRel setSelectedCode(String selectedCode) {
		this.selectedCode=selectedCode;
		return this;
	}
	
	/**
	 * 获得 paperQuestionItemList<br>
	 * paperQuestionItemList
	 * @return paperQuestionItemList
	*/
	public List<PaperQuestionItem> getPaperQuestionItemList() {
		return paperQuestionItemList;
	}
	
	/**
	 * 设置 paperQuestionItemList
	 * @param paperQuestionItemList paperQuestionItemList
	 * @return 当前对象
	*/
	public PaperQuestionRel setPaperQuestionItemList(List<PaperQuestionItem> paperQuestionItemList) {
		this.paperQuestionItemList=paperQuestionItemList;
		return this;
	}
	
	/**
	 * 添加 paperQuestionItemList
	 * @param paperQuestionItem paperQuestionItemList
	 * @return 当前对象
	*/
	public PaperQuestionRel addPaperQuestionItem(PaperQuestionItem... paperQuestionItem) {
		if(this.paperQuestionItemList==null) {
			paperQuestionItemList=new ArrayList<>();
		}
		this.paperQuestionItemList.addAll(Arrays.asList(paperQuestionItem));
		return this;
	}
	
	/**
	 * 获得 paperQuestionAnswerList<br>
	 * paperQuestionAnswerList
	 * @return paperQuestionAnswerList
	*/
	public List<PaperQuestionAnswer> getPaperQuestionAnswerList() {
		return paperQuestionAnswerList;
	}
	
	/**
	 * 设置 paperQuestionAnswerList
	 * @param paperQuestionAnswerList paperQuestionAnswerList
	 * @return 当前对象
	*/
	public PaperQuestionRel setPaperQuestionAnswerList(List<PaperQuestionAnswer> paperQuestionAnswerList) {
		this.paperQuestionAnswerList=paperQuestionAnswerList;
		return this;
	}
	
	/**
	 * 添加 paperQuestionAnswerList
	 * @param paperQuestionAnswer paperQuestionAnswerList
	 * @return 当前对象
	*/
	public PaperQuestionRel addPaperQuestionAnswer(PaperQuestionAnswer... paperQuestionAnswer) {
		if(this.paperQuestionAnswerList==null) {
			paperQuestionAnswerList=new ArrayList<>();
		}
		this.paperQuestionAnswerList.addAll(Arrays.asList(paperQuestionAnswer));
		return this;
	}

	/**
	 * 将自己转换成指定类型的PO
	 * @param poType  PO类型
	 * @return PaperQuestionRel , 转换好的 PaperQuestionRel 对象
	*/
	@Transient
	public <T extends Entity> T toPO(Class<T> poType) {
		return EntityContext.create(poType, this);
	}

	/**
	 * 将自己转换成任意指定类型
	 * @param pojoType  Pojo类型
	 * @return PaperQuestionRel , 转换好的 PoJo 对象
	*/
	@Transient
	public <T> T toPojo(Class<T> pojoType) {
		if(Entity.class.isAssignableFrom(pojoType)) {
			return (T)this.toPO((Class<Entity>)pojoType);
		}
		try {
			T pojo=pojoType.newInstance();
			EntityContext.copyProperties(pojo, this);
			return pojo;
		} catch (Exception e) {
			throw new RuntimeException(e);
		}
	}

	/**
	 * 克隆当前对象
	*/
	@Transient
	public PaperQuestionRel clone() {
		return duplicate(true);
	}

	/**
	 * 复制当前对象
	 * @param all 是否复制全部属性，当 false 时，仅复制来自数据表的属性
	*/
	@Transient
	public PaperQuestionRel duplicate(boolean all) {
		com.dt.platform.domain.hr.meta.PaperQuestionRelMeta.$$proxy$$ inst = new com.dt.platform.domain.hr.meta.PaperQuestionRelMeta.$$proxy$$();
		inst.setQuestionImageId(this.getQuestionImageId());
		inst.setQuestionId(this.getQuestionId());
		inst.setQuestionFileId(this.getQuestionFileId());
		inst.setQuestionNumber(this.getQuestionNumber());
		inst.setItemText(this.getItemText());
		inst.setScore(this.getScore());
		inst.setUpdateBy(this.getUpdateBy());
		inst.setId(this.getId());
		inst.setPaperId(this.getPaperId());
		inst.setItemAnswerTextRight(this.getItemAnswerTextRight());
		inst.setUpdateTime(this.getUpdateTime());
		inst.setQuestionName(this.getQuestionName());
		inst.setSort(this.getSort());
		inst.setVersion(this.getVersion());
		inst.setLearnPaperId(this.getLearnPaperId());
		inst.setItemAnswerText(this.getItemAnswerText());
		inst.setCreateBy(this.getCreateBy());
		inst.setDeleted(this.getDeleted());
		inst.setCreateTime(this.getCreateTime());
		inst.setDeleteTime(this.getDeleteTime());
		inst.setDeleteBy(this.getDeleteBy());
		inst.setQuestionType(this.getQuestionType());
		inst.setQuestionLevel(this.getQuestionLevel());
		inst.setQuestionAnalysis(this.getQuestionAnalysis());
		inst.setIsAnswer(this.getIsAnswer());
		if(all) {
			inst.setPaperQuestion(this.getPaperQuestion());
			inst.setLearnPaper(this.getLearnPaper());
			inst.setPaper(this.getPaper());
			inst.setLevelDict(this.getLevelDict());
			inst.setPaperQuestionItemList(this.getPaperQuestionItemList());
			inst.setPaperQuestionAnswerList(this.getPaperQuestionAnswerList());
			inst.setSelectedCode(this.getSelectedCode());
		}
		inst.clearModifies();
		return inst;
	}

	/**
	 * 克隆当前对象
	*/
	@Transient
	public PaperQuestionRel clone(boolean deep) {
		return EntityContext.clone(PaperQuestionRel.class,this,deep);
	}

	/**
	 * 将 Map 转换成 PaperQuestionRel
	 * @param paperQuestionRelMap 包含实体信息的 Map 对象
	 * @return PaperQuestionRel , 转换好的的 PaperQuestionRel 对象
	*/
	@Transient
	public static PaperQuestionRel createFrom(Map<String,Object> paperQuestionRelMap) {
		if(paperQuestionRelMap==null) return null;
		PaperQuestionRel po = create();
		EntityContext.copyProperties(po,paperQuestionRelMap);
		po.clearModifies();
		return po;
	}

	/**
	 * 将 Pojo 转换成 PaperQuestionRel
	 * @param pojo 包含实体信息的 Pojo 对象
	 * @return PaperQuestionRel , 转换好的的 PaperQuestionRel 对象
	*/
	@Transient
	public static PaperQuestionRel createFrom(Object pojo) {
		if(pojo==null) return null;
		PaperQuestionRel po = create();
		EntityContext.copyProperties(po,pojo);
		po.clearModifies();
		return po;
	}

	/**
	 * 创建一个 PaperQuestionRel，等同于 new
	 * @return PaperQuestionRel 对象
	*/
	@Transient
	public static PaperQuestionRel create() {
		return new com.dt.platform.domain.hr.meta.PaperQuestionRelMeta.$$proxy$$();
	}

	/**
	 * 从 Map 读取
	 * @param map 记录数据
	 * @param cast 是否用 DataParser 进行类型转换
	 * @return  是否读取成功
	*/
	public boolean read(Map<String, Object> map,boolean cast) {
		if(map==null) return false;
		if(cast) {
			this.setQuestionImageId(DataParser.parse(String.class, map.get(PaperQuestionRelMeta.QUESTION_IMAGE_ID)));
			this.setQuestionId(DataParser.parse(String.class, map.get(PaperQuestionRelMeta.QUESTION_ID)));
			this.setQuestionFileId(DataParser.parse(String.class, map.get(PaperQuestionRelMeta.QUESTION_FILE_ID)));
			this.setQuestionNumber(DataParser.parse(Integer.class, map.get(PaperQuestionRelMeta.QUESTION_NUMBER)));
			this.setItemText(DataParser.parse(String.class, map.get(PaperQuestionRelMeta.ITEM_TEXT)));
			this.setScore(DataParser.parse(BigDecimal.class, map.get(PaperQuestionRelMeta.SCORE)));
			this.setUpdateBy(DataParser.parse(String.class, map.get(PaperQuestionRelMeta.UPDATE_BY)));
			this.setId(DataParser.parse(String.class, map.get(PaperQuestionRelMeta.ID)));
			this.setPaperId(DataParser.parse(String.class, map.get(PaperQuestionRelMeta.PAPER_ID)));
			this.setItemAnswerTextRight(DataParser.parse(String.class, map.get(PaperQuestionRelMeta.ITEM_ANSWER_TEXT_RIGHT)));
			this.setUpdateTime(DataParser.parse(Date.class, map.get(PaperQuestionRelMeta.UPDATE_TIME)));
			this.setQuestionName(DataParser.parse(String.class, map.get(PaperQuestionRelMeta.QUESTION_NAME)));
			this.setSort(DataParser.parse(Integer.class, map.get(PaperQuestionRelMeta.SORT)));
			this.setVersion(DataParser.parse(Integer.class, map.get(PaperQuestionRelMeta.VERSION)));
			this.setLearnPaperId(DataParser.parse(String.class, map.get(PaperQuestionRelMeta.LEARN_PAPER_ID)));
			this.setItemAnswerText(DataParser.parse(String.class, map.get(PaperQuestionRelMeta.ITEM_ANSWER_TEXT)));
			this.setCreateBy(DataParser.parse(String.class, map.get(PaperQuestionRelMeta.CREATE_BY)));
			this.setDeleted(DataParser.parse(Integer.class, map.get(PaperQuestionRelMeta.DELETED)));
			this.setCreateTime(DataParser.parse(Date.class, map.get(PaperQuestionRelMeta.CREATE_TIME)));
			this.setDeleteTime(DataParser.parse(Date.class, map.get(PaperQuestionRelMeta.DELETE_TIME)));
			this.setDeleteBy(DataParser.parse(String.class, map.get(PaperQuestionRelMeta.DELETE_BY)));
			this.setQuestionType(DataParser.parse(String.class, map.get(PaperQuestionRelMeta.QUESTION_TYPE)));
			this.setQuestionLevel(DataParser.parse(String.class, map.get(PaperQuestionRelMeta.QUESTION_LEVEL)));
			this.setQuestionAnalysis(DataParser.parse(String.class, map.get(PaperQuestionRelMeta.QUESTION_ANALYSIS)));
			this.setIsAnswer(DataParser.parse(String.class, map.get(PaperQuestionRelMeta.IS_ANSWER)));
			// others
			this.setPaperQuestion(DataParser.parse(PaperQuestion.class, map.get(PaperQuestionRelMeta.PAPER_QUESTION)));
			this.setLearnPaper(DataParser.parse(LearnPaper.class, map.get(PaperQuestionRelMeta.LEARN_PAPER)));
			this.setPaper(DataParser.parse(Paper.class, map.get(PaperQuestionRelMeta.PAPER)));
			this.setLevelDict(DataParser.parse(DictItem.class, map.get(PaperQuestionRelMeta.LEVEL_DICT)));
			this.setSelectedCode(DataParser.parse(String.class, map.get(PaperQuestionRelMeta.SELECTED_CODE)));
			return true;
		} else {
			try {
				this.setQuestionImageId( (String)map.get(PaperQuestionRelMeta.QUESTION_IMAGE_ID));
				this.setQuestionId( (String)map.get(PaperQuestionRelMeta.QUESTION_ID));
				this.setQuestionFileId( (String)map.get(PaperQuestionRelMeta.QUESTION_FILE_ID));
				this.setQuestionNumber( (Integer)map.get(PaperQuestionRelMeta.QUESTION_NUMBER));
				this.setItemText( (String)map.get(PaperQuestionRelMeta.ITEM_TEXT));
				this.setScore( (BigDecimal)map.get(PaperQuestionRelMeta.SCORE));
				this.setUpdateBy( (String)map.get(PaperQuestionRelMeta.UPDATE_BY));
				this.setId( (String)map.get(PaperQuestionRelMeta.ID));
				this.setPaperId( (String)map.get(PaperQuestionRelMeta.PAPER_ID));
				this.setItemAnswerTextRight( (String)map.get(PaperQuestionRelMeta.ITEM_ANSWER_TEXT_RIGHT));
				this.setUpdateTime( (Date)map.get(PaperQuestionRelMeta.UPDATE_TIME));
				this.setQuestionName( (String)map.get(PaperQuestionRelMeta.QUESTION_NAME));
				this.setSort( (Integer)map.get(PaperQuestionRelMeta.SORT));
				this.setVersion( (Integer)map.get(PaperQuestionRelMeta.VERSION));
				this.setLearnPaperId( (String)map.get(PaperQuestionRelMeta.LEARN_PAPER_ID));
				this.setItemAnswerText( (String)map.get(PaperQuestionRelMeta.ITEM_ANSWER_TEXT));
				this.setCreateBy( (String)map.get(PaperQuestionRelMeta.CREATE_BY));
				this.setDeleted( (Integer)map.get(PaperQuestionRelMeta.DELETED));
				this.setCreateTime( (Date)map.get(PaperQuestionRelMeta.CREATE_TIME));
				this.setDeleteTime( (Date)map.get(PaperQuestionRelMeta.DELETE_TIME));
				this.setDeleteBy( (String)map.get(PaperQuestionRelMeta.DELETE_BY));
				this.setQuestionType( (String)map.get(PaperQuestionRelMeta.QUESTION_TYPE));
				this.setQuestionLevel( (String)map.get(PaperQuestionRelMeta.QUESTION_LEVEL));
				this.setQuestionAnalysis( (String)map.get(PaperQuestionRelMeta.QUESTION_ANALYSIS));
				this.setIsAnswer( (String)map.get(PaperQuestionRelMeta.IS_ANSWER));
				// others
				this.setPaperQuestion( (PaperQuestion)map.get(PaperQuestionRelMeta.PAPER_QUESTION));
				this.setLearnPaper( (LearnPaper)map.get(PaperQuestionRelMeta.LEARN_PAPER));
				this.setPaper( (Paper)map.get(PaperQuestionRelMeta.PAPER));
				this.setLevelDict( (DictItem)map.get(PaperQuestionRelMeta.LEVEL_DICT));
				this.setSelectedCode( (String)map.get(PaperQuestionRelMeta.SELECTED_CODE));
				return true;
			} catch (Exception e) {
				return false;
			}
		}
	}

	/**
	 * 从 Map 读取
	 * @param r 记录数据
	 * @param cast 是否用 DataParser 进行类型转换
	 * @return  是否读取成功
	*/
	public boolean read(ExprRcd r,boolean cast) {
		if(r==null) return false;
		if(cast) {
			this.setQuestionImageId(DataParser.parse(String.class, r.getValue(PaperQuestionRelMeta.QUESTION_IMAGE_ID)));
			this.setQuestionId(DataParser.parse(String.class, r.getValue(PaperQuestionRelMeta.QUESTION_ID)));
			this.setQuestionFileId(DataParser.parse(String.class, r.getValue(PaperQuestionRelMeta.QUESTION_FILE_ID)));
			this.setQuestionNumber(DataParser.parse(Integer.class, r.getValue(PaperQuestionRelMeta.QUESTION_NUMBER)));
			this.setItemText(DataParser.parse(String.class, r.getValue(PaperQuestionRelMeta.ITEM_TEXT)));
			this.setScore(DataParser.parse(BigDecimal.class, r.getValue(PaperQuestionRelMeta.SCORE)));
			this.setUpdateBy(DataParser.parse(String.class, r.getValue(PaperQuestionRelMeta.UPDATE_BY)));
			this.setId(DataParser.parse(String.class, r.getValue(PaperQuestionRelMeta.ID)));
			this.setPaperId(DataParser.parse(String.class, r.getValue(PaperQuestionRelMeta.PAPER_ID)));
			this.setItemAnswerTextRight(DataParser.parse(String.class, r.getValue(PaperQuestionRelMeta.ITEM_ANSWER_TEXT_RIGHT)));
			this.setUpdateTime(DataParser.parse(Date.class, r.getValue(PaperQuestionRelMeta.UPDATE_TIME)));
			this.setQuestionName(DataParser.parse(String.class, r.getValue(PaperQuestionRelMeta.QUESTION_NAME)));
			this.setSort(DataParser.parse(Integer.class, r.getValue(PaperQuestionRelMeta.SORT)));
			this.setVersion(DataParser.parse(Integer.class, r.getValue(PaperQuestionRelMeta.VERSION)));
			this.setLearnPaperId(DataParser.parse(String.class, r.getValue(PaperQuestionRelMeta.LEARN_PAPER_ID)));
			this.setItemAnswerText(DataParser.parse(String.class, r.getValue(PaperQuestionRelMeta.ITEM_ANSWER_TEXT)));
			this.setCreateBy(DataParser.parse(String.class, r.getValue(PaperQuestionRelMeta.CREATE_BY)));
			this.setDeleted(DataParser.parse(Integer.class, r.getValue(PaperQuestionRelMeta.DELETED)));
			this.setCreateTime(DataParser.parse(Date.class, r.getValue(PaperQuestionRelMeta.CREATE_TIME)));
			this.setDeleteTime(DataParser.parse(Date.class, r.getValue(PaperQuestionRelMeta.DELETE_TIME)));
			this.setDeleteBy(DataParser.parse(String.class, r.getValue(PaperQuestionRelMeta.DELETE_BY)));
			this.setQuestionType(DataParser.parse(String.class, r.getValue(PaperQuestionRelMeta.QUESTION_TYPE)));
			this.setQuestionLevel(DataParser.parse(String.class, r.getValue(PaperQuestionRelMeta.QUESTION_LEVEL)));
			this.setQuestionAnalysis(DataParser.parse(String.class, r.getValue(PaperQuestionRelMeta.QUESTION_ANALYSIS)));
			this.setIsAnswer(DataParser.parse(String.class, r.getValue(PaperQuestionRelMeta.IS_ANSWER)));
			return true;
		} else {
			try {
				this.setQuestionImageId( (String)r.getValue(PaperQuestionRelMeta.QUESTION_IMAGE_ID));
				this.setQuestionId( (String)r.getValue(PaperQuestionRelMeta.QUESTION_ID));
				this.setQuestionFileId( (String)r.getValue(PaperQuestionRelMeta.QUESTION_FILE_ID));
				this.setQuestionNumber( (Integer)r.getValue(PaperQuestionRelMeta.QUESTION_NUMBER));
				this.setItemText( (String)r.getValue(PaperQuestionRelMeta.ITEM_TEXT));
				this.setScore( (BigDecimal)r.getValue(PaperQuestionRelMeta.SCORE));
				this.setUpdateBy( (String)r.getValue(PaperQuestionRelMeta.UPDATE_BY));
				this.setId( (String)r.getValue(PaperQuestionRelMeta.ID));
				this.setPaperId( (String)r.getValue(PaperQuestionRelMeta.PAPER_ID));
				this.setItemAnswerTextRight( (String)r.getValue(PaperQuestionRelMeta.ITEM_ANSWER_TEXT_RIGHT));
				this.setUpdateTime( (Date)r.getValue(PaperQuestionRelMeta.UPDATE_TIME));
				this.setQuestionName( (String)r.getValue(PaperQuestionRelMeta.QUESTION_NAME));
				this.setSort( (Integer)r.getValue(PaperQuestionRelMeta.SORT));
				this.setVersion( (Integer)r.getValue(PaperQuestionRelMeta.VERSION));
				this.setLearnPaperId( (String)r.getValue(PaperQuestionRelMeta.LEARN_PAPER_ID));
				this.setItemAnswerText( (String)r.getValue(PaperQuestionRelMeta.ITEM_ANSWER_TEXT));
				this.setCreateBy( (String)r.getValue(PaperQuestionRelMeta.CREATE_BY));
				this.setDeleted( (Integer)r.getValue(PaperQuestionRelMeta.DELETED));
				this.setCreateTime( (Date)r.getValue(PaperQuestionRelMeta.CREATE_TIME));
				this.setDeleteTime( (Date)r.getValue(PaperQuestionRelMeta.DELETE_TIME));
				this.setDeleteBy( (String)r.getValue(PaperQuestionRelMeta.DELETE_BY));
				this.setQuestionType( (String)r.getValue(PaperQuestionRelMeta.QUESTION_TYPE));
				this.setQuestionLevel( (String)r.getValue(PaperQuestionRelMeta.QUESTION_LEVEL));
				this.setQuestionAnalysis( (String)r.getValue(PaperQuestionRelMeta.QUESTION_ANALYSIS));
				this.setIsAnswer( (String)r.getValue(PaperQuestionRelMeta.IS_ANSWER));
				return true;
			} catch (Exception e) {
				return false;
			}
		}
	}
}